# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-aiosmtpd
pkgver=1.4.5
pkgrel=0
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=aiosmtpd
pkgdesc="asyncio based SMTP server"
url="https://github.com/aio-libs/aiosmtpd"
arch="noarch"
license="Apache-2.0"
depends="
	py3-attrs
	py3-atpublic
"
checkdepends="
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-cov
	py3-pytest-mock
"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/aio-libs/aiosmtpd/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
d33441aa3179cab0711dbbf14a9b243d292195cce41b730e9fd965ffaa40c4bbf4a61acdc4e209c93f370a058dd1f207258cc4207746dbe5e14fa4c83837f137  py3-aiosmtpd-1.4.5.tar.gz
"
